<h2><span class="title">Vítejte</span> v instalaci redakčního systému VisionCMS.</h2>
<p>Pro práci s instalátorem je potřeba mít povolený JavaScript a Cookies !</p>
<h2 class="underline-item">Základní kontrola</h2>
<?php

/**
 * @author Martin Pernica
 * @copyright 2009
 */
 
$check = array();
$help = array("", "", "", "", "", "", "", "", "", "", "");
$checksum = 0;
$checksum_need = 11;
//Core check
if(version_compare("5", phpversion(), "<=")){
	$check[0] = true;
	$checksum++;
}else{
	$check[0] = false;
	$help[0] = 'Váš hosting nepodporuje PHP 5 !';
}

if(function_exists("simplexml_load_file")){
	$check[1] = true;
	$checksum++;
}else{
	$check[1] = false;
	$help[1] = 'Váš hosting nepodporuje SimpleXML !';
}

if(function_exists("gd_info")){
	$check[2] = true;
	$checksum++;
}else{
	$check[2] = false;
	$help[2] = 'Váš hosting nepodporuje GD knihovnu !';
}

//Files

if(substr(decoct( fileperms('../env.php') ), 2) == '777'){
	$check[3] = true;
	$checksum++;
}else{
	$check[3] = false;
	$help[3] = 'chmod 777 souboru env.php';
}

if(substr(decoct( fileperms('../components/') ), 2) == '777'){
	$check[4] = true;
	$checksum++;
}else{
	$check[4] = false;
	$help[4] = 'chmod 777 složce components';
}

if(substr(decoct( fileperms('../modules/') ), 2) == '777'){
	$check[5] = true;
	$checksum++;
}else{
	$check[5] = false;
	$help[5] = 'chmod 777 složce modules';
}

if(substr(decoct( fileperms('../templates/') ), 2) == '777'){
	$check[6] = true;
	$checksum++;
}else{
	$check[6] = false;
	$help[6] = 'chmod 777 složce templates';
}

if(substr(decoct( fileperms('../cache/') ), 2) == '777'){
	$check[7] = true;
	$checksum++;
}else{
	$check[7] = false;
	$help[7] = 'chmod 777 složce cache';
}

if(substr(decoct( fileperms('../temp/') ), 2) == '777'){
	$check[8] = true;
	$checksum++;
}else{
	$check[8] = false;
	$help[8] = 'chmod 777 složce temp';
}

if(substr(decoct( fileperms('../public/') ), 2) == '777'){
	$check[9] = true;
	$checksum++;
}else{
	$check[9] = false;
	$help[9] = 'chmod 777 složce public';
}

if(substr(decoct( fileperms('../components/com_user/avatars/') ), 2) == '777'){
	$check[10] = true;
	$checksum++;
}else{
	$check[10] = false;
	$help[10] = 'chmod 777 složce components/com_user/avatars/';
}
?>
<table>
<tr><th>Technologie</th><th>Stav</th></tr>
<tr>
<td>PHP: v5.1.0 nebo lepší</td>
<td><img src="./images/<?php echo intval($check[0]); ?>.png" alt="" /></td>
<td><p class="help"><?php echo $help[0]; ?></p></td>
</tr>

<tr><td>SQL: MySQL v4.1.0 (5.0.0 nebo lepší jsou preferovány)</td><td><img src="./images/q.png" alt="" /></td><td></td></tr>

</table>

<h2 class="underline-item">Kontrola PHP rozšíření</h2>

<table>
<tr><th>Rozšíření</th><th>Stav</th><th>Řešení</th></tr>
<tr>
<td>SimpleXML</td>
<td><img src="./images/<?php echo intval($check[1]); ?>.png" alt="" /></td>
<td><p class="help"><?php echo $help[1]; ?></p></td>
</tr>

<tr>
<td>GD Library</td>
<td><img src="./images/<?php echo intval($check[2]); ?>.png" alt="" /></td>
<td><p class="help"><?php echo $help[2]; ?></p></td>
</tr>

</table>

<h2 class="underline-item">Kontrola oprávění souborů/složek</h2>

<table>

<tr><th>Soubor/Složka</th><th>Stav</th><th>Řešení</th></tr>

<tr>
<td class="file">env.php</td>
<td><img src="./images/<?php echo intval($check[3]); ?>.png" alt="" /></td>
<td><p class="help"><?php echo $help[3]; ?></p></td>
</tr>

<tr>
<td class="folder">components</td>
<td><img src="./images/<?php echo intval($check[4]); ?>.png" alt="" /></td>
<td><p class="help"><?php echo $help[4]; ?></p></td>
</tr>

<tr>
<td class="folder">modules</td>
<td><img src="./images/<?php echo intval($check[5]); ?>.png" alt="" /></td>
<td><p class="help"><?php echo $help[5]; ?></p></td>
</tr>

<tr>
<td class="folder">templates</td>
<td><img src="./images/<?php echo intval($check[6]); ?>.png" alt="" /></td>
<td><p class="help"><?php echo $help[6]; ?></p></td>
</tr>

<tr>
<td class="folder">cache</td>
<td><img src="./images/<?php echo intval($check[7]); ?>.png" alt="" /></td>
<td><p class="help"><?php echo $help[7]; ?></p></td>
</tr>

<tr>
<td class="folder">temp</td>
<td><img src="./images/<?php echo intval($check[8]); ?>.png" alt="" /></td>
<td><p class="help"><?php echo $help[8]; ?></p></td>
</tr>

<tr>
<td class="folder">public</td>
<td><img src="./images/<?php echo intval($check[9]); ?>.png" alt="" /></td>
<td><p class="help"><?php echo $help[9]; ?></p></td>
</tr>

<tr>
<td class="folder">components/com_user/avatars/</td>
<td><img src="./images/<?php echo intval($check[10]); ?>.png" alt="" /></td>
<td><p class="help"><?php echo $help[10]; ?></p></td>
</tr>

</table>
<?php

if($check[3] === false){
	$checksum++;
	echo '<p class="msg info">Instalátor nebude zapisovat do souboru env.php .</p>';
	$_SESSION['env_nowrite'] = true;
}else{
	$_SESSION['env_nowrite'] = false;
}

$buttons_left .= VInstallater::PrintButton("cancel");
if($checksum != $checksum_need){
	$buttons_right .= VInstallater::PrintButton("right-inactive");
}else{
	$_SESSION['step1'] = true;
	$buttons_right .= VInstallater::PrintButton("right");
}

$menu = "<li class=\"now\"> 1. Kontrola</li>\n
<li> 2. Licence</li>\n
<li> 3. Nastavení</li>\n
<li> 4. Účet správce</li>\n
<li> 5. Přehled</li>\n
<li> 6. Instalace</li>\n
<li> 7. Výsledek instalace</li>\n";

?>